import 'package:flutter/material.dart';

class MyApp9 extends StatelessWidget {
  const MyApp9({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Row组件的使用'),
        backgroundColor: Colors.red,
      ),
      body: Center(
          child: Container(
        width: MediaQuery.of(context).size.width,
        height: 100,
        color: Color.fromARGB(255, 137, 211, 238),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Image.network(
              'https://yanxuan-item.nosdn.127.net/afd6199278a5b8fd783bc4947960fabc.jpg',
              width: 80,
            ),
            const SizedBox(width: 30),
            const Expanded(
                child: Text(
              //存在问题,文字超出一行后不会换行->使用Expanded解决
              '茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯',
              style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold),
            ))
          ],
        ),
      )),
    );
  }
}
